<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:th="http://www.thymeleaf.org"
    xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3">
	<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>upload page</title>
	<script type="text/javascript" src="/templates/example/jquery-1.11.1.js"></script>
	</head>
	<body>
		<div class="excel-upload">
			<p>Excel上传、保存</p>
			<form id="form">
				<input type="file" name="file" />
				<br /> 
				<input type="text" name="token" value="fdf37ba1-2c81-40d7-8400-38275c422cd5"/>
				<br /> 
				
				
				<input type="button" id="excelBtn" value="上传">
				
			</form>
		</div>
		<script type="text/javascript">
			$('#excelBtn').click(function(){
				var formData = new FormData($(".excel-upload form")[0]);
				formData.append("tagCode","09384b45-433b-455a-911f-cbe9ba803fef");
				formData.append("repeatDeal","IGNORE");

				 $.ajax({  
			          url: "/base/customer/import",  
			          type: 'POST',  
			          data: formData,  
			          async: false,  
			          cache: false,  
			          contentType: false,  
			          processData: false,  
			          success: function (returndata) {  
			        	  $.each(returndata.validateErrMsg,function(i,msg){
			        		  console.log(msg.field);
			        		  $.each(msg.message,function(j,detail){
			        			  console.log(detail);
			        		  })
			        	  })
			          },  
			          error: function (returndata) {  
			        	  console.log(returndata);  
			          }  
			     });  
			})
		</script>
	</body>
</html>